interface move {
  moveDestination(): string;
}
class Man implements move {
  constructor(private destination: string) {}
  moveDestination() {
    return "步行" + this.destination;
  }
}
class Car implements move {
  constructor(private oilNumber: number) {}
  moveDestination() {
    return "跑到目的用了" + this.oilNumber + "升油";
  }
}

let m: move = new Man('shanghai');
if(m instanceof Man) {
  // 可以将m的类型收窄到Man
  // instanceof只对类有效。当判断的对象不是某个类的实例时就无效
  console.log(m.moveDestination());
}



export {};
